<template>
	<div class="grandson">
		<h1>我是Grandson组件</h1>
		<h4>我爷爷给我一个房子:{{house}}</h4>
		<button @click="sendToy">把四驱车给我爷爷玩</button>
	</div>
</template>

<script>
	export default {
		name:'Grandson',
		props:['house','getToy'],
		data() {
			return {
				toy:'四驱车'
			}
		},
		methods:{
			sendToy(){
				this.getToy(this.toy)
			}
		}
	}
</script>

<style scoped>
	.grandson{
		background-color: orange;
		padding: 20px;
	}
</style>